<template>
  <div id="tools">
    <div class="mz-content container clearfix">
      <div class="tools-heading">
        <h1>Flyme Design APP</h1>
        <p>新系统的公共视觉规范，包含视觉，动画，开发等内容</p>
        <a href="#">查看更多></a>
      </div>
      <div class="menu-content">
        <section class="menu-layout" v-for="title in categoryName">
          <div class="menu-title">
            <p>{{ title.categoryName }}</p>
          </div>
          <div class="menu-wrapper">
            <div class="menu-list" v-for="item in title.data">
              <div class="menu-list-img"><img :src="item.icon"/></div>
              <router-link class="menu-info" to="#">
                <h4>{{ item.title }}</h4>
                <p>{{ item.desc }}</p>
              </router-link>
            </div>
          </div>
        </section>
      </div>
    </div>
  </div>
</template>

<script>

  export default {
    name: 'tools',
    data() {
      return{
        categoryName:[],
      }
    },
    created(){
      this.$http.get('http://172.17.140.113:8360/api/tools').then(response => {
        if (response.body && response.body.errno != 0) {
          let msg = response.body ? response.body.errmsg : '请求异常！！！'
          console.log(msg)
          return
        }
        try {
          response = response.body.data
            //console.dir(response)
          this.categoryName = response
        }
        catch(e){
          console.log("catch error")
        }

      }, response => {
        console.log(response)
      });
    }
  }
</script>

<style scoped>
  /*工具和规范*/
  .tools-heading {
    background: url("../assets/img/bg-standard.png") no-repeat;
    background-size: cover;
    padding: 80px 60px 115px 92px;
  }

  .tools-heading h1 {
    font-weight: 700;
    font-size: 42px;
    font-weight: 700;
  }

  .tools-heading p {
    font-size: 16px;
  }

  .tools-heading h1, .tools-heading p, .tools-heading a {
    color: #fff;
  }

  .tools-heading a {
    display: block;
    margin-top: 37px;
  }

  .menu-content {
    background: #fff;
    padding: 58px 80px 160px;
  }

  .menu-layout {
    margin-bottom: 7px;
  }

  .menu-title {
    margin-bottom: 30px;
  }

  .menu-title p {
    font-weight: 700;
    font-size: 15px;
    color: #777;
  }

  .menu-wrapper {

  }

  .menu-list {
    display: inline-block;
    width: calc((100% - 40px) / 2);
    padding: 0 0 64px 0;
    margin-right: 20px;
  }

  .menu-list-img {
    width: 64px;
    height: 64px;
    float: left;
    margin-right: 20px;
  }

  .menu-list-img img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
  }

  .menu-info {
    display: block;
  }

  .menu-info h4 {
    font-weight: 700;
    font-size: 21px;
    color: #000;
    margin: 5px 0 10px 0;
  }

  .menu-info p {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin: 0;
  }

  @media screen and (max-width: 768px) {
    .mz-content {
      margin: 0 auto;
      max-width: 100%;
      padding: 0;
      position: relative;
      background: #fff;
    }

    .menu-content {
      background: #fff;
      padding: 20px 18px;
    }

    .tools-heading {
      padding: 36px 36px 56px 36px;
    }

    .tools-heading h1 {
      font-size: 26px;
    }

    .tools-heading p {
      font-size: 14px;
    }


    .menu-list {
      display: inline-block;
      width: calc(100%);
      padding: 0 0 20px 0;
    }

    .menu-layout {
      margin-bottom: 30px;
    }

    .menu-list-img {
      width: 49px;
      height: 49px;
    }

    .menu-list-img img {
      width: 100%;
      height: 100%;
      border-radius: 50%;
    }

    .menu-info h4 {
      margin-top: 0;
    }



  }
</style>
